﻿<?php
	require_once('model.php');
	
	$id_sp = 0;
	if (isset($_GET['id']) == true){
	
		$error = 0;
		if (is_numeric($_GET['id']) == false){
			$error = 1;
		}
		
		if ($error == 1){
			header("Location:".$config_basedir);			
		}
		else{
			$id_sp = $_GET['id'];
		}
	}
	//lay data
	$sp = GetSpById($id_sp);
	if($sp)
		$ten_sp = $sp['ten_sp'];
	else
		$ten_sp = null;
	
	require_once('sp_view.phtml');
?>